<template>
	<view class="header">
		<view class="header-title">
			<text class="text">橙色营养师</text>
		</view>

		<view class="header-input"  @click="toSearch">
			<image class="img1" src="../../static/icon_search.png" />
			<text class="text">请输入食物名称</text>
			<image class="img2" src="../../static/ic_library_scan.png" />
		</view>

		<view class="header-list">
			<ul class="nav">
				<li @click="toFoodComparison">
					<image class="img" src="../../static/ic_scan_code_comparison_v1.png" />
					<text class="text">食物对比</text>
				</li>
				<li @click="toFoodRanking">
					<image class="img" src="../../static/ic_home_list.png" />
					<text class="text">食物排行榜</text>
				</li>
				<li @click="toLogin">
					<image class="img" src="../../static/ic_search_comparison.png" />
					<text class="text">配料识别</text>
				</li>
			</ul>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods:{
			toSearch(){
				uni.navigateTo({
					url:"../../subpkg/SearchPage/SearchPage"
				})
			},
			toFoodComparison(){
				uni.navigateTo({
					url:"../../subpkg/FoodComparison/FoodComparison"
				})
			},
			toFoodRanking(){
				uni.navigateTo({
					url:"../../subpkg/FoodRanking/FoodRanking"
				})
			},
			toLogin(){
				
			}
		}
	}
</script>

<style lang="scss">
	.header {
		overflow: hidden;
		height: 200px;
		background: url("../../static/img_home_bg.jpg") no-repeat center;
		background-size: cover;

		.header-title {
			margin: 15px 0;
			font-weight: bold;
			color: rgba(255, 255, 255, 0.9);
			font-size: 20px;
			letter-spacing: 2px;
		}

		.header-input {
			display: flex;
			margin: 10px auto;
			width: 94%;
			margin-top: 40px;
			border-radius: 10px;
			background: white;
			justify-content: space-between;
			align-items: center;
			height: 45px;
			box-sizing: border-box;
			padding: 0 10px;

			.img1 {
				width: 15px;
				height: 15px;
			}

			.img2 {
				width: 30px;
				height: 30px;
			}


			.text {
				flex: 1;
				text-align: left;
				font-size: 14px;
				margin-left: 5px;
				color: #A5A9BA;
				letter-spacing: 1px;
			}
		}

		.header-list {
			margin-top: 30px;

			ul {
				display: flex;
				justify-content: space-evenly;
				align-items: center;
				padding: 0;

				li {
					display: flex;
					justify-content: center;
					align-items: center;

					.img {
						width: 18px;
						height: 18px;
						margin-right: 5px;
					}

					.text {
						font-size: 13px;
						color: #FDF3EC;
					}
				}
			}
		}
	}
</style>
